<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://paycn.com.cn/pos" prefix="p"%>

<div class="container-fluid">
	<div class="row-fluid">
		<div class="span12">
			<h3 class="page-title">部门管理</h3>
			<ul class="breadcrumb">
				<li>
					<i class="icon-home"></i>
					<a href="<c:url value="/home.html"/>">首页</a> 
					<i class="icon-angle-right"></i>
				</li>
				<li><a href="#">部门管理</a></li>
			</ul>
		</div>
	</div>
	
	<div class="row-fluid">
		<div class="span12">
			<c:if test="${messageSuccess!=null }">
				<div class="alert alert-success">
					<strong>成功!</strong> ${messageSuccess }
				</div>
			</c:if>
			<c:if test="${messageError!=null }">
				<div class="alert alert-error">
					<strong>失败!</strong> ${messageError }
				</div>
			</c:if>
			<div class="portlet">
				<div class="portlet-title">
					<div class="caption"><i class="icon-search"></i> 查询</div>
					<div class="tools">
						<a class="collapse" href="javascript:;"></a>
					</div>
				</div>
				<div class="portlet-body">
					<form action="<c:url value='/department/query.html'/>" class="form-inline">
						<div class="row-fluid">
							<div class="span2 query">
								<div class="control-group">
									<label class="control-label">部门编号</label>
									<div class="controls">
										<input type="text" name="departmentCode" class="m-wrap span12">
									</div>
								</div>
							</div>
							<div class="span2 query">
								<div class="control-group">
									<label class="control-label">部门名称</label>
									<div class="controls">
										<input type="text" name="departmentName" class="m-wrap span12">
									</div>
								</div>
							</div>
							<div class="span2 query">
								<div class="control-group">
									<label class="control-label">&nbsp;</label>
									<div class="controls">
										<button type="submit" class="btn blue purple-stripe"><i class="icon-search"></i> 查询</button>
									</div>
								</div>
							</div>
						</div>
					</form>
					
				</div>
			</div>
		</div>
	</div>
	
	<div class="row-fluid">
		<div class="span12">
			<div class="portlet box grey">
				<div class="portlet-title">
					<div class="caption"><i class="icon-bookmark"></i> 部门列表</div>
					<div class="actions">
						<a class="btn green" href="<c:url value="/department/add.html"/>"><i class="icon-plus"></i> 添加部门</a>
					</div>
				</div>
				<div class="portlet-body no-more-tables">
					<table class="table table-bordered table-striped table-hover">
						<thead>
							<tr>
								<th>部门编号</th>
								<th>部门名称</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${dataGrid.rows}" var="row">
								<tr>
									<td data-title="部门编号">${row.departmentCode}</td>
									<td data-title="部门名称">${row.departmentName}</td>
									<td data-title="操作">
										<a href="<c:url value="/department/${row.id}/edit.html"/>" class="btn mini blue"><i class="icon-edit"></i> 修改</a>
										<a href="<c:url value="/department/delete.html?id=${row.id}"/>" class="btn mini red remote-confirm"><i class="icon-trash"></i> 删除</a>
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
					 <p:pagination url="/department/query.html" total="${dataGrid.total}"/>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript" src="<c:url value="/static/js/commons-confirm.js"/>"></script>
<script type="text/javascript">
$(document).ready(function(){
	$(".remote-confirm").confirm({
		title: "删除部门",
		message: "确定删除部门吗？"
	});
});
</script>
